package com.yumeng.common.data.validator.annotation;

import com.yumeng.common.data.validator.DateValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author wxd
 * @date 2022/10/25 16:28
 */
@Documented
@Constraint(validatedBy = { DateValidator.class })
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
public @interface DateFormat {

    String message() default "日期格式异常：yyyy-MM-dd";
    String format() default "yyyy-MM-dd";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

}
